package com.yehongyu.mytools.core.system;

import java.util.Iterator;
import java.util.Map;
import java.util.Properties;

public class SystemProperties {
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println(System.getProperty("user.dir"));//user.dir指定了当前的路径
		System.out.println(System.getProperty("java.class.path"));
		System.out.println(System.getProperty("file.encoding"));
		Properties p = System.getProperties();
		for(Map.Entry<Object,Object> en:p.entrySet()){
			System.out.println(en.getKey()+"="+en.getValue());
		}

		Map<String,String> env = System.getenv();
		Iterator<Map.Entry<String,String>> it = env.entrySet().iterator();
		Map.Entry<String,String> i;
		while(it.hasNext()){
			i = it.next();
			System.out.println(i.getKey()+":"+i.getValue());
		}
	}

}
